<?php
session_start(); 
include "application.php";
include "common.php";
application_start();
//var $strUsers;
//var $currTimeout;
$arrUsers = array();
//var $i;
 
$strUsers = $_APP["strUsers"];
 
$arrUsers = split("\|",$strUsers);
 
$strUsers = "";
   
for ($i=0; $i<count($arrUsers); $i++) 
{
	
	$currTimeout = $_APP["Timeout_".$arrUsers[$i]];
	if($arrUsers[$i] != "")
	{
	//	if (date_add("n", 5, date("n/j/Y g:i:s A")() ) > $currTimeout) {
		if (date(DateAdd(date("n/j/Y g:i:s A"),0,0,0,0,5,0) ) > date($currTimeout)) {
			$strUsers = $strUsers . '<TR><TD><FONT COLOR="#AAAAAA" TITLE="Less than 5 minutes from timeout">' . $arrUsers[$i] . "</FONT></TD>" . "\n";
		} else {
			$strUsers = $strUsers . "<TR><TD>" . $arrUsers[$i] . "</TD>" . "\n";
		}
		//$strUsers = $strUsers . "<TD>" . CInt(Application("intChatTimeout")) - DateDiff("n", date("n/j/Y g:i:s A"), $currTimeout) . "</TD></TR>";
		//round($_APP["intChatTimeout"]) . "-" .
		$strUsers = $strUsers . "<TD>" . round(DateDiff($currTimeout ,date("n/j/Y g:i:s A"),"m")) . "</TD></TR>";
	}
}
?>
<HTML>
<HEAD>
<? include "style.php"; ?>
<META HTTP-EQUIV=refresh content="4">
</HEAD>
<BODY BGCOLOR="<? echo $strFrameColor; ?>" TOPMARGIN=0 BOTTOMMARGIN=0 LEFTMARGIN=0 RIGHTMARGIN=0 BORDER=0>
<TABLE WIDTH="100%" HEIGHT="100%">
	<TR><TD COLSPAN=2><B>Who's Here:</B></TD></TR>
	<TR><TD VALIGN="TOP" NOWRAP><U>Nickname</U></TD><TD VALIGN="TOP" NOWRAP><U>Idle(min)</U></TD></TR>
<? echo $strUsers; ?>
	<TR><TD COLSPAN=2 HEIGHT="100%"> &nbsp; </TD></TR>
</TABLE>
</BODY>
</HTML>
